#PHP magic constants
Explore tagged Tumblr posts
Text
PHP Magic Constants Explained with Examples
Learn PHP Magic Constants in detail with easy examples. Understand __LINE__, __FILE__, __CLASS__, and more. Best guide for beginners and pros. 🌟 PHP Magic Constants: A Complete Beginner-Friendly Guide PHP Magic Constants are built-in constants that change depending on their context within the code. Unlike regular constants, their values are not fixed. Instead, they provide dynamic information…
0 notes
Text
Magic Constants
Magic constants are the predefined constants in PHP which get changed on the basis of their use. They start with double underscore (__) and ends with double underscore.
They are similar to other predefined constants but as they change their values with the context, they are called magic constants.
There are nine magic constants in PHP. In which eight magic constants start and end with double underscores (__).

0 notes
Text
PHP and the Revolution of CMS Development with Mindfire Solutions
In today's digital world, content is king. But what's even more paramount is the platform that helps manage this content seamlessly. Enter Content Management Systems (CMS) - the unsung heroes behind every powerful website. When paired with the dynamism of PHP, a programming language revered for its agility, CMS platforms transcend their ordinary functions, offering an unparalleled web development experience. Here, we plunge into the universe of PHP-driven CMS and unpack its myriad benefits.

Understanding PHP in the Web Cosmos
PHP, which stands for Hypertext Preprocessor, is the linchpin of server-side web development. This open-source language shines for its ability to produce dynamic web pages. Its intrinsic characteristics include:
Effortless amalgamation with web technologies
Robust database compatibility
An ever-thriving community of developers
Inherent safety protocols
Compatibility across diverse platforms
The CMS Landscape
A CMS is akin to the control room of a website. It's where all the magic happens—creating, modifying, and managing content without any technical hiccups. From e-commerce giants to humble blogs, CMS platforms drive them all. While there's a plethora of CMS variants - from open-source marvels like WordPress and Drupal to proprietary powerhouses like Adobe Experience Manager - their core mission remains constant: simplify web content management.
When PHP Meets CMS
With its adaptability and efficiency, PHP has become synonymous with robust CMS development. Here's how PHP powers these platforms:
Adaptive Nature: PHP's open-source credentials allow developers to tweak it endlessly, crafting bespoke web solutions.
Holistic Integration: PHP's marriage with CMS platforms ensures dynamic HTML page creation, thus fueling dynamic content delivery.
Global Community: PHP's sprawling community is a treasure trove of resources, plugins, and extensions. This ecosystem enriches CMS platforms, ensuring they're always a step ahead.
Popular PHP-CMS Duos:
WordPress: This CMS titan, armed with PHP, powers a significant chunk of the web. With its vast array of plugins, WordPress continues to be a crowd favorite.
Drupal: Known for its adaptability, Drupal, when combined with PHP, serves organizations, delivering complex web solutions.
Joomla: Simplifying web development, Joomla offers a user-centric interface and has carved its niche in the PHP-CMS realm.
Why Embrace PHP-driven CMS?
User-Centric Design: PHP-driven CMS platforms are a dream come true for non-techies, allowing them to manage intricate web content effortlessly. 2. Developer's Playground: The customizability that PHP brings to the table ensures developers can tweak CMS platforms endlessly, realizing even the most ambitious web visions. 3. Multi-Device Compatibility: Responsive by nature, PHP-driven CMS platforms ensure uniform content delivery across devices. 4. Thriving Ecosystem: PHP's sprawling community ensures a continuous influx of plugins and extensions, supercharging CMS platforms' capabilities.
Mindfire Solutions' Take

The fusion of PHP with CMS platforms has revolutionized web development. This combination promises scalability, versatility, and efficiency. At Mindfire Solutions, we believe that this synergy of PHP and CMS platforms, such as WordPress and Drupal, offers the perfect recipe for future-ready web solutions.
As web landscapes evolve, the demand for dynamic, scalable, and efficient content management solutions will only surge. PHP's role in molding these CMS platforms ensures that businesses can consistently deliver enriched web experiences. Join us in exploring and harnessing the endless potentials of PHP-infused CMS solutions!
0 notes
Text
PHP Programming Help for Students
The PHP Assignment for students can include questions based on the OOPs concepts in PHP, Database Management in PHP, Session, Cookies, Real-Time applications, and basic knowledge of at least one framework of PHP. Sometimes the PHP assignments for practice may include questions related to pre-requisites of PHP such as HTML, CSS, and JavaScript. Whatever your need may be, https://www.bestassignmentsupport.com/programming-assignment-help/php-assignment-help.php has a team of PHP programming experts who can help you write your PHP assignments by providing you access to a lot of information that you can use as a point of reference in your assignments.
PHP ASSIGNMENT WRITING HELP FROM BASIC TO ADVANCED MODULES
Our PHP assignment help online will include all the topics from the Foundation of PHP to advanced PHP modules. PHP assignments for beginners may vary from the simplest scripts to some complex tasks. Some of the basic PHP assignment help topics are:
Topics Covered in PHP
Introduction to PH
What is PHP: installation and setup
PHP echo
PHP print
Variables and constants in PHP
Rules to define variables and constants in PHP
Types of variables: local, global and static
Magic constants in PHP
Data types in PHP
Scalar types
Compound types
Special types
Operators in PHP
Arithmetic Operators
Comparison Operators
Bitwise Operators
Logical Operators
Incrementing/Decrementing Operators
Array Operators
Type Operators
Execution Operators
Error Control Operators
Assignment Operators
Control statements in PHP
#PHP Project Help#PHP#PHP Homework Help#PHP Assignment Helpers#PHP Assignment Help#Best PHP Assignment Help#Best Online PHP Assignment Help
3 notes
·
View notes
Text
Php training course
PHP Course Overview
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.
PHP can generate the dynamic page content
PHP can create, open, read, write, and close files on the server
PHP can collect form data
PHP can send and receive cookies
PHP can add, delete, modify data in your database
PHP can restrict users to access some pages on your website
PHP can encrypt data
With PHP you are not limited to output HTML. You can output images, PDF files, and even Flash movies. You can also output any text, such as XHTML and XML.
PHP Training Course Prerequisite
HTML
CSS
Javascript
Objectives of the Course
PHP runs on different platforms (Windows, Linux, Unix, Mac OS X, etc.)
PHP is compatible with almost all servers used today (Apache, IIS, etc.)
PHP has support for a wide range of databases
PHP is free. Download it from the official PHP resource: www.php.net
PHP is easy to learn and runs efficiently on the server-side
PHP Training Course Duration
45 Working days, daily 1.30 hours
PHP Training Course Overview
An Introduction to PHP
History of PHP
Versions and Differences between them
Practicality
Power
Installation and configuring Apache and PHP
PHP Basics
Default Syntax
Styles of PHP Tags
Comments in PHP
Output functions in PHP
Datatypes in PHP
Configuration Settings
Error Types
Variables in PHP
Variable Declarations
Variable Scope
PHP’s Superglobal Variables
Variable Variables
Constants in PHP
Magic Constants
Standard Pre-defined Constants
Core Pre-defined Languages
User-defined Constants
Control Structures
Execution Control Statements
Conditional Statements
Looping Statements with Real-time Examples
Functions
Creating Functions
Passing Arguments by Value and Reference
Recursive Functions
Arrays
What is an Array?
How to create an Array
Traversing Arrays
Array Functions
Include Functions
Include, Include_once
Require, Require_once
Regular Expressions
Validating text boxes,emails,phone number,etc
Creating custom regular expressions
Object-Oriented Programming in PHP
Classes, Objects, Fields, Properties, _set(), Constants, Methods
Encapsulation
Inheritance and types
Polymorphism
Constructor and Destructor
Static Class Members, Instance of Keyword, Helper Functions
Object Cloning and Copy
Reflections
PHP with MySQL
What is MySQL
Integration with MySQL
MySQL functions
Gmail Data Grid options
SQL Injection
Uploading and downloading images in Database
Registration and Login forms with validations
Pegging, Sorting,…..
Strings and Regular Expressions
Declarations styles of String Variables
Heredoc style
String Functions
Regular Expression Syntax(POSIX)
PHP’s Regular Expression Functions(POSIX Extended)
Working with the Files and Operating System
File Functions
Open, Create and Delete files
Create Directories and Manipulate them
Information about Hard Disk
Directory Functions
Calculating File, Directory and Disk Sizes
Error and Exception Handling
Error Logging
Configuration Directives
PHP’s Exception Class
Throw New Exception
Custom Exceptions
Date and Time Functions
Authentication
HTTP Authentication
PHP Authentication
Authentication Methodologies
Cookies
Why Cookies
Types of Cookies
How to Create and Access Cookies
Sessions
Session Variables
Creating and Destroying a Session
Retrieving and Setting the Session ID
Encoding and Decoding Session Data
Auto-Login
Recently Viewed Document Index
Web Services
Why Web Services
RSS Syntax
SOAP
How to Access Web Services
XML Integration
What is XML
Create an XML file from PHP with Database records
Reading Information from XML File
MySQL Concepts
Introduction
Storage Engines
Functions
Operators
Constraints
DDL commands
DML Commands
DCL Command
TCL Commands
Views
Joins
Cursors
Indexing
Stored Procedures
Mysql with PHP Programming
Mysql with Sqlserver(Optional)
SPECIAL DELIVERY
Protocols
HTTP Headers and types
Sending Mails using PHP
Email with Attachment
File Uploading and Downloading using Headers
Implementing Chating Applications using PHP
and Ajax
SMS Gateways and sending SMS to Mobiles
Payments gateways and How to Integrate them
With Complete
MVC Architecture
DRUPAL
JOOMLA
Word Press
AJAX
CSS
JQUERY (Introduction and few plugins only)
1 note
·
View note
Text
FIGHTING FEAR AND ANXIETY WITH THE PROMISES OF GOD
Day 2 of 5
When You Need God’s Peace over Panic:
The enemy will always lure us towards panic and worry if we focus on all that is wrong in this world. But God offers us confident peace that can never be found in this life without Him. I struggled with fear and worry for years. Maybe you find yourself there too many days. But through time, I began to find the things that once would have sent me down an anxious spiral, no longer had the same effect. It didn’t happen quickly, but over days, months, years.
I read words of life, of truth, soaking them in, over and over, praying them out loud until they became so familiar, they replaced the other things in my mind that I’d battled against. There’s nothing magical about words and verses, but there is power through them, because they’re God’s words.
Change happened. Anxious thoughts began to diminish. Worry let go of its constant grip. And though fear is sometimes still there, it no longer wields control, holding me back, paralyzing me in its grasp.
His words are “life” words, soothing to our soul, calming to our spirits, giving power to our days.
It’s not always easy, and it often comes down to a choice:
- Choosing not to allow fear and anxiety to control your life.
- Choosing to guard your heart.
- Choosing to focus your mind on what is truth in the midst of uncertain times.
We might still feel afraid, but we can believe that God is with us. We may not be in control, but we can trust the One who is. We may not know the future, but we can find security in the God who does.
Dear God,
We choose faith over fear today. We choose to set our eyes on you and not on our circumstances. We choose joy over despair and peace over worry. Silence the lies of the enemy over us. Please give us the awareness we need to step over his traps. Help us choose not to worry but instead to pray about all that concerns us, allowing your Spirit to guard our hearts and minds in Christ Jesus. We trust you to protect our way and to bring us safely through these problems we’re facing. Thank you for your great care over us, we love you Lord, and we need you, today and every day.
In Jesus’ Name,
Amen.
Be anxious for nothing, but in everything by prayer and supplication, with thanksgiving, let your requests be made known to God; and the peace of God, which surpasses all understanding, will guard your hearts and minds through Christ Jesus. Finally, brethren, whatever things are true, whatever things are noble, whatever things are just, whatever things are pure, whatever things are lovely, whatever things are of good report, if there is any virtue and if there is anything praiseworthy—meditate on these things.
Philippians 4:6-8 NKJV
https://bible.com/bible/114/php.4.6-8.NKJV
0 notes
Text
PHP Error Handling. Everything You Need To Know
PHP Error Handling. Everything You Need To Know Lets learn about Error Handling in PHP, because no developer can avoid errors. So in today's article you will learn what PHP error handling is and how to use it. #php #phperrorhandling #webdev #errorhandling
Last time we talked about Magic Constants in PHP. Now lets learn about Error Handling in PHP, because no developer can avoid errors. So in today’s article you will learn what PHP error handling is and how to use it. Handling Errors When creating website you most definitely will run into errors and your code will not work as you planned. There are a number of reasons why errors appeared, for…
View On WordPress
#coding#error#errorhandling#errorhandlinginphp#learntocode#PHP#programming#tutorial#web#webdev#webdevelopment
0 notes
Text
A Guide to the Responsive Images Syntax in HTML
Only View Code Snippets
This guide is about the HTML syntax for responsive images (and a little bit of CSS for good measure). The responsive images syntax is about serving one image from multiple options based on rules and circumstances. There are two forms of responsive images, and they’re for two different things:
If your only goal is…
Increased Performance
Then what you need is…
<img srcset="" src="" alt="" >
There is a lot of performance gain to be had by using responsive images. Image weight has a huge impact on pages’ overall performance, and responsive images are one of the best things that you can do to cut image weight. Imagine the browser being able to choose between a 300×300 image or a 600×600. If the browser only needs the 300×300, that’s potentially a 4× bytes-over-the-wire savings! Savings generally go up as the display resolution and viewport size go down; on the smallest screens, a couple of case studies have shown byte savings of 70–90%.
Using srcset
If you also need…
Design Control
Then what you need is…
<picture> <source srcset="" media=""> <source srcset="" media=""> <img src="" alt=""> </picture>
Another perfectly legit goal with responsive images is not just to serve different sizes of the same image, but to serve different images. For example, cropping an image differently depending on the size of the screen and differences in the layout. This is referred to as “art direction.”
The <picture> element is also used for fallback image types and any other sort of media query switching (e.g. different images for dark mode). You get greater control of what browsers display.
Using <picture>
There is a lot to talk about here, so let’s go through both syntaxes, all of the related attributes and values, and talk about a few related subjects along the way, like tooling and browsers.
Table of Contents
Using srcset
Using <picture>
Where do you get the differently-sized images?
Automated responsive images
Related concepts
What about responsive images in CSS with background images?
Do you need to polyfill?
Other important image considerations
Other good resources
Browser support
Using srcset
The <img srcset="" src="" alt=""> syntax is for serving differently-sized versions of the same image. You could try to serve entirely different images using this syntax, but browsers assume that everything in a srcset is visually-identical and will choose whichever size they think is best, in impossible-for-you-to-predict ways. So I wouldn’t reccomend it.
Perhaps the easiest-possible responsive images syntax is adding a srcset attribute with x descriptors on the images to label them for use on displays with different pixel-densities.
<img alt="A baby smiling with a yellow headband." src="baby-lowres.jpg" srcset="baby-highres.jpg 2x" >
Here, we’ve made the default (the src) the “low res” (1×) copy of the image. Defaulting to the smallest/fastest resources is usually the smart choice:. We also provide a 2× version. If the browser knows it is on a higher pixel-density display (the 2x part), it will use that image instead.
Demo
<img alt="A baby smiling with a yellow headband." src="baby-lowres.jpg" srcset=" baby-high-1.jpg 1.5x, baby-high-2.jpg 2x, baby-high-3.jpg 3x, baby-high-4.jpg 4x, baby-high-5.jpg 100x " >
You can do as many pixel-density variants as you like.
While this is cool and useful, x descriptors only account for a small percentage of responsive images usage. Why? They only let browsers adapt based on one thing: display pixel-density. A lot of times, though, our responsive images are on responsive layouts, and the image’s layout size is shrinking and stretching right along with the viewport. In those situations, the browser needs to make decisions based on two things: the pixel-density of the screen, and the layout size of the image. That’s where w descriptors and the sizes attribute come in, which we’ll look at in the next section.
Using srcset / w + sizes
This is the good stuff. This accounts for around 85% of responsive images usage on the web. We’re still serving the same image at multiple sizes, only we’re giving the browser more information so that it can adapt based on both pixel-density and layout size.
<img alt="A baby smiling with a yellow headband." srcset=" baby-s.jpg 300w, baby-m.jpg 600w, baby-l.jpg 1200w, baby-xl.jpg 2000w " sizes="70vmin" >
We’re still providing multiple copies of the same image and letting the browser pick the most appropriate one. But instead of labeling them with a pixel density (x) we’re labelling them with their resource width, using w descriptors. So if baby-s.jpg is 300×450, we label it as 300w.
Using srcset with width (w) descriptors like this means that it will need to be paired with the sizes attribute so that the browser will know how large of a space the image will be displaying in. Without this information, browsers can’t make smart choices.
Demo
Creating accurate sizes
Creating sizes attributes can get tricky. The sizes attribute describes the width that the image will display within the layout of your specific site, meaning it is closely tied to your CSS. The width that images render at is layout-dependent rather than just viewport dependent!
Let’s take a look at a fairly simple layout with three breakpoints. Here’s a video demonstrating this:
Demo
The breakpoints are expressed with media queries in CSS:
body { margin: 2rem; font: 500 125% system-ui, sans-serif; } .page-wrap { display: grid; gap: 1rem; grid-template-columns: 1fr 200px; grid-template-areas: "header header" "main aside" "footer footer"; } @media (max-width: 700px) { .page-wrap { grid-template-columns: 100%; grid-template-areas: "header" "main" "aside" "footer"; } } @media (max-width: 500px) { body { margin: 0; } }
The image is sized differently at each breakpoint. Here’s a breakdown of all of the bits and pieces that affect the image’s layout width at the largest breakpoint (when the viewport is wider than 700px):
The image is as wide as 100vw minus all that explicitly sized margin, padding, column widths, and gap.
At the largest size: there is 9rem of explicit spacing, so the image is calc(100vw - 9rem - 200px) wide. If that column used a fr unit instead of 200px, we’d kinda be screwed here.
At the medium size: the sidebar is dropped below, so there is less spacing to consider. Still, we can do calc(100vw - 6rem) to account for the margins and padding.
At the smallest size: the body margin is removed, so just calc(100vw - 2rem) will do the trick.
Phew! To be honest, I found that a little challenging to think out, and made a bunch of mistakes as I was creating this. In the end, I had this:
<img ... sizes=" (max-width: 500px) calc(100vw - 2rem), (max-width: 700px) calc(100vw - 6rem), calc(100vw - 9rem - 200px) " />
A sizes attribute that gives the browser the width of the image across all three breakpoints, factoring in the layout grid, and all of the surrounding gap, margin, and padding that end up impacting the image’s width.
Now wait! Drumroll!
That’s still wrong. I don’t understand why exactly, because to me that looks like it 100% describes what is happening in the CSS layout. But it’s wrong because Martin Auswöger’s RespImageLint says so. Running that tool over the isolated demo reports no problems except the fact that the sizes attribute is wrong for some viewport sizes, and should be:
<img ... sizes=" (min-width: 2420px) 2000px, (min-width: 720px) calc(94.76vw - 274px), (min-width: 520px) calc(100vw - 96px), calc(100vw - 32px) " >
I don’t know how that’s calculated and it’s entirely unmaintainable by hand, but, it’s accurate. Martin’s tool programmatically resizes the page a bunch and writes out a sizes attribute that describes the actual, observed width of the image over a wide range of viewport sizes. It’s computers, doing math, so it’s right. So, if you want a super-accurate sizes attribute, I’d recommend just putting a wrong one on at first, running this tool, and copying out the correct one.
For an even deeper dive into all this, check out Eric Portis’ w descriptors and sizes: Under the hood.
Being more chill about sizes
Another option is use the Horseshoes & Hand Grenades Method
of sizes (or, in other words, close counts).
For example, sizes="96vw" says, “This image is going to be pretty big on the page — almost the full width — but there will always be a little padding around the edges, so not quite. Or sizes="(min-width: 1000px) 33vw, 96vw" says, “This image is in a three-column layout on large screens and close to full-width otherwise.” Practicality-wise, this can be a sane solution.
You might find that some automated responsive image solutions, which have no way of knowing your layout, make a guess — something like sizes="(max-width: 1000px) 100vw, 1000px". This is just saying, “Hey we don’t really know much about this layout, but we’re gonna take a stab and say, worst case, the image is full-width, and let’s hope it never renders larger than 1000px”.
Abstracting sizes
I’m sure you can imagine how easy it is to not only get sizes wrong, but also have it become wrong over time as layouts change on your site. It may be smart for you to abstract it using a templating language or content filter so that you can change the value across all of your images more easily.
I’m essentially talking about setting a sizes value in a variable once, and using that variable in a bunch of different <img> elements across your site. Native HTML doesn’t offer that, but any back end language does; for instance, PHP constants, Rails config variables, the React context API used for a global state variable, or variables within a templating language like Liquid can all be used to abstract sizes.
<?php // Somewhere global $my_sizes = ""; ?> <img srcset="" src="" alt="" sizes="<?php echo $my_sizes; ?>" />
“Browser’s choice”
Now that we have a sizes attribute in place, the browser knows what size (or close to it) the image will render at and can work its magic. That is, it can do some math that factors in the pixel density of the screen, and the size that the image will render at, then pick the most appropriately-sized image.
The math is fairly straightforward at first. Say you’re about to show an image that is 40vw wide on a viewport that is 1200px wide, on a 2x pixel-density screen. The perfect image would be 960 pixels wide, so the browser is going to look for the closest thing it’s got. The browser will always calculate a target size that it would prefer based on the viewport and pixel-density situations, and what it knows from sizes, and compare that target to what it’s got to pick from in srcset. How browsers do the picking, though, can get a little weird.
A browser might factor more things into this equation if it chooses to. For example, it could consider the user’s current network speeds, or whether or not the user has flipped on some sort of “data saver” preference. I’m not sure if any browsers actually do this sort of thing, but they are free to if they wish as that’s how the spec was written. What some browsers sometimes choose to do is pull from cache. If the math shows they should be using a 300px image, but they already have a 600px in local cache, they will just use that. Smart. Room for this sort of thing is a strength of the srcset/sizes syntax. It’s also why you always use different sizes of the same image, within srcset: you’ve got no way to know which image is going to be selected. It’s the browser’s choice.
This is weird. Doesn’t the browser already know this stuff?
You might be thinking, “Uhm why do I have to tell the browser how big the image will render, doesn’t it know that?” Well, it does, but only after it’s downloaded your HTML and CSS and laid everything out. The sizes attribute is about speed. It gives the browser enough information to make a smart choice as soon as it sees your <img>.
<img data-sizes="auto" data-srcset=" responsive-image1.jpg 300w, responsive-image2.jpg 600w, responsive-image3.jpg 900w" class="lazyload" />
Now you might be thinking, “But what about lazy-loaded images?” (as in, by the time a lazy-loaded image is requested, layout’s already been done and the browser already knows the image’s render size). Well, good thinking! Alexander Farkas’ lazysizes library writes out sizes attributes automatically on lazyload, and there’s an ongoing discussion about how to do auto-sizes for lazy-loaded images, natively.
sizes can be bigger than the viewport
Quick note on sizes. Say you have an effect on your site so that an image “zooms in” when it’s clicked. Maybe it expands to fill the whole viewport, or maybe it zooms even more, so that you can see more detail. In the past, we might have had to swap out the src on click in order to switch to a higher-res version. But now, assuming a higher-res source is already in the srcset, you can just change the sizes attribute to something huge, like 200vw or 300vw, and the browser should download the super-high-res source automatically for you. Here’s an article by Scott Jehl on this technique.
Back to top
Using <picture>
Hopefully, we’ve beaten it into the ground that <img srcset="" sizes="" alt=""> is for serving differently-sized versions of the same image. The <picture> syntax can do that too, but the difference here is that the browser must respect the rules that you set. That’s useful when you want to change more than just the resolution of the loaded image to fit the user’s situation. This intentional changing of the image is usually called “art direction.”
Art Direction
<picture> <source srcset="baby-zoomed-out.jpg" media="(min-width: 1000px)" /> <source srcset="baby.jpg" media="(min-width: 600px)" /> <img src="baby-zoomed-in.jpg" alt="Baby Sleeping" /> </picture>
This code block is an example of what it might look like to have three stages of an “art directed” image.
On large screens, show a zoomed-out photo.
On medium screens, show that same photo, zoomed in a bit.
On small screens, zoom in even more.
The browser must respect our media queries and will swap images at our exact breakpoints. That way, we can be absolutely sure that nobody on a small screen will see a tiny, zoomed-out image, which might not have the same impact as one of the zoomed-in versions.
Here’s a demo, written in Pug to abstract out some of the repetitive nature of <picture>.
CodePen Embed Fallback
Art direction can do a lot more than just cropping
Although cropping and zooming like this is the most common form of art direction by far, you can do a lot more with it. For instance, you can:
Dark-ify
images for users in dark mode,
avoid sending animated GIFs to users with a “prefers reduced motion” accessibility preference,
re-arrange image content so that it all fits “above the fold” on short viewports,
set a maximum resolution cap, to save users on 3×-plus devices a lot of bytes,
send static, high-res, monochrome images to printers and e-ink devices.
Sky’s the limit, really.
Combining source and srcset
Because <source> also uses the srcset syntax, they can be combined. This means that you can still reap the performance benefits of srcset even while swapping out visually-different images with <source>. It gets pretty verbose though!
<picture> <source srcset=" baby-zoomed-out-2x.jpg 2x, baby-zoomed-out.jpg " media="(min-width: 1000px)" /> <source srcset=" baby-2x.jpg 2x, baby.jpg " media="(min-width: 600px)" /> <img srcset=" baby-zoomed-out-2x.jpg 2x " src="baby-zoomed-out.jpg" alt="Baby Sleeping" /> </picture>
The more variations you create and the more resized versions you create per variation, the more verbose this code has to get.
Fallbacks for modern image formats
The <picture> element is uniquely suited to being able to handle “fallbacks.” That is, images in cutting-edge formats that not all browsers might be able to handle, with alternative formats for browsers that can’t load the preferred, fancy one. For example, let’s say you want to use an image in the WebP format. It’s a pretty great image format, often being the most performant choice, and it’s supported everywhere that the <picture> element is, except Safari. You can handle that situation yourself, like:
<picture> <source srcset="party.webp"> <img src="party.jpg" alt="A huge party with cakes."> </picture>
This succeeds in serving a WebP image to browsers that support it, and falls back to a JPEG image, which is definitely supported by all browsers.
Here’s an example of a photograph (of me) at the exact same size where the WebP version is about 10% (!!!) of the size of the JPEG.
CodePen Embed Fallback
How do you create a WebP image? Well, it’s more of a pain in the butt than you’d like it to be, that’s for sure. There are online converters, command line tools, and some modern design software, like Sketch, helps you export in that format. My preference is to use an image hosting CDN service that automatically sends images in the perfect format for the requesting browser, which makes all this unnecessary (because you can just use img/srcset).
WebP isn’t the only player like this. Safari doesn’t support WebP, but does support a format called JPG 2000 which has some advantages over JPEG. Internet Explorer 11 happens to support an image format called JPEG-XR which has different advantages. So to hit all three, that could look like:
<picture> <source srcset="/images/cereal-box.webp" type="image/webp" /> <source srcset="/images/cereal-box.jp2" type="image/jp2" /> <img src="/images/cereal-box.jxr" type="image/vnd.ms-photo" /> </picture>
This syntax (borrowed form a blog post by Josh Comeau) supports all three of the “next-gen” image formats in one go. IE 11 doesn’t support the <picture> syntax, but it doesn’t matter because it will get the <img> fallback which is in the JPEG-XR format it understands.
Estelle Weyl also covered this idea in a 2016 blog post on image optimization.
Back to top
Where do you get the differently-sized images?
You can make them yourself. Heck, even the free Preview app on my Mac can resize an image and “Save As.”
The Mac Preview app resizing an image, which is something that literally any image editing application (including Photoshop, Affinity Designer, Acorn, etc.) can also do. Plus, they often help by exporting the variations all at once.
But that’s work. It’s more likely that the creation of variations of these images is automated somehow (see the section below) or you use a service that allows you to create variations just by manipulating the URL to the image. That’s a super common feature of any image hosting/image CDN service. To name a few:
Cloudinary offers it
Netlify offers it
imgix offers it
Image Optim offers it
Filestack offers it
Cloudflare offers it
Not only do these services offer on-the-fly image resizing, they also often offer additional stuff, like cropping, filtering, adding text, and all kinds of useful features, not to mention serving assets efficiently from a CDN and automatically in next-gen formats. That makes them a really strong choice for just about any website, I’d say.
Here’s Glen Maddern in a really great screencast talking about how useful Image CDNs can be:
youtube
Design software is booming more aware that we often need multiple copies of images. The exporting interface from Figma is pretty nice, where any given selection can be exported. It allows multiple exports at once (in different sizes and formats) and remembers what you dod the last time you exported.
Exporting in Figma
Automated responsive images
The syntax of responsive images is complex to the point that doing it by hand is often out of the question. I’d highly recommend automating and abstracting as much of this away as possible. Fortunately, a lot of tooling that helps you build websites knows this and includes some sort of support for it. I think that’s great because that’s what software should be doing for us, particularly when it is something that is entirely programmatic and can be done better by code than by humans. Here are some examples…
Cloudinary has this responsive breakpoints tool including an API for generating the perfect breakpoints.
WordPress generates multiple versions of images and outputs in the responsive images syntax by default.
Gatsby has a grab-bag of plugins for transforming and implementing images on your site. You ultimately implement them with gatsby-image, which is a whole fancy thing for implementing responsive images and other image loading optimizations. Speaking of React, it has component abstractions like “An Almost Ideal React Image Component” that also does cool stuff.
Nicolas Hoizey’s Images Responsiver Node module (and it’s Eleventy plugin) makes a ton of smart markup choices for you, and pairs nicely with a CDN that can handle the on-the-fly resizing bits.
These are just a few examples! Literally anything you can do to make this process easier or automatic is worth doing.
Here’s me inspecting an image in a WordPress blog post and seeing a beefy srcset with a healthy amount of pre-generated size options and a sizes attribute tailored to this theme.
A landing page for gatsby-image explaining all of the additional image loading stuff it can do.
I’m sure there are many more CMSs and other software products that help automate away the complexities of creating the responsive images syntax. While I love that all this syntax exists, I find it all entirely too cumbersome to author by hand. Still, I think it’s worth knowing all this syntax so that we can build our own abstractions, or check in on the abstractions we’re using to make sure they are doing things correctly.
Related concepts
The object-fit property in CSS controls how an image will behave in its own box. For example, an image will normally “squish” if you change the dimensions to something different than its natural aspect ratio, but object-fit can be used to crop it or contain it instead.
The object-position property in CSS allows you to nudge an image around within its box.
What about responsive images in CSS with background images?
We’ve covered exactly this before. The trick is to use @media queries to change the background-image source. For example:
.img { background-image: url(small.jpg); } @media (min-width: 468px), (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) { .img { background-image: url(large.jpg); } }
With this CSS syntax, depending on the browser conditions, the browser will only download one of the two images, which achieves the same performance goal that the responsive images syntax in HTML does. If it helps, think of the above as the CSS equivalent of the <picture> syntax: the browser must follow your rules and display what matches.
If you’re looking to let the browser choose the best option, like srcset/sizes, but in CSS, the solution is ultimately going to be the image-set() function. There’s two problems with image-set(), today, though:
Support for it isn’t there yet. Safari’s implementation leads the pack, but image-set() has been prefixed in Chrome for eight years, and it’s not there at all in Firefox.
Even the spec itself seems behind the times. For example, it only supports x descriptors (no w, yet).
Best to just use media queries for now.
Do you need to polyfill?
I’m pretty meh on pollyfilling any of this right this moment. There is a great polyfill though, called Picturefill, which will buy you full IE 9-11 support if you need that. Remember, though, that none of this stuff breaks to the point of not displaying any image at all in non-supporting browsers, assuming you have an <img src="" alt=""> in there somewhere. If you make the (fairly safe) assumption that IE 11 is running on a low-pixel-density desktop display, you can make your image sources reflect that by default and build out from there.
Other important image considerations
Optimizing quality: The point of responsive images is loading the smallest, most impactful resource that you can. You can’t achieve that without effectively compressing your image. You’re aiming for a “sweet spot” for every image, between looking good and being light. I like to let image hosting services solve this problem for me, but Etsy has a really great writeup of what they’ve been able to accomplish with infrastructure that they built themselves.
Serving from CDNs: Speaking of image hosting services, speed comes in many forms. Fast servers that are geographically close to the user are an important speed factor as well.
Caching: What’s better than loading less data over the network? Loading no data at all! That’s what HTTP caching is for. Using the Cache-Control header, you can tell the browser to hang on to images so that if the same image is needed again, the browser doesn’t have to go over the network to get it, which is a massive performance boost for repeat viewings.
Lazy loading: This is another way to avoid loading images entirely. Lazy loading means waiting to download an image until it is in or near the viewport. So, for example, an image way far down the page won’t load if the user never scrolls there.
Other good resources
(That I haven’t linked up in the post already!)
Eric Portis on the Cloudinary blog: Responsive images with ‘srcset’, ‘sizes’ and Cloudinary
Eric Portis’ deep dive into Srcset and sizes
Eric Portis on Smashing Magazine: Responsive Images Done Right: A Guide To <picture> And srcset
MDN Guide: Responsive images
Jason Grigsby’s big 10-part guide on the Cloudfour blog
Scott Vandehey on the Cloudfour blog: Responsive Images the Simple Way
The original W3C Community Group that fought for responsive images in browsers and got it done
Pete LePage on the Google Developer Web Fundamentals Guide: Images
Addy Osmani’s Essential Image Optimization eBook
Elad Shechter’s Complete Guide to Responsive Images
Mat Marquis’ conference talk: The Past, Present, and Future of Responsive Images
Mat Marquis’ book Image Performance
Jake Archibald’s The anatomy of responsive images
Responsive Images, WordPress, and Cloudinary
Andreas Bovens on Opera’s Developer Blog: Responsive Images: Use Cases and Documented Code Snippets to Get You Started
Browser Support
This is for srcset/sizes, but it’s the same for <picture>.
This browser support data is from Caniuse, which has more detail. A number indicates that browser supports the feature at that version and up.
Desktop
Chrome Firefox IE Edge Safari 38 38 No 16 9
Mobile / Tablet
Android Chrome Android Firefox Android iOS Safari 81 68 81 9.0-9.2
The post A Guide to the Responsive Images Syntax in HTML appeared first on CSS-Tricks.
source https://css-tricks.com/a-guide-to-the-responsive-images-syntax-in-html/
from WordPress https://ift.tt/3d6myJJ via IFTTT
0 notes
Text
Fear the Beard
The list of NBA players who were able to capture the Most Valuable Player award in back to back seasons is not a very long one. This list includes some of the games greatest players to ever grace the hardwood, from Bill Russell and Wilt Chamberlain to Magic Johnson and Larry Bird, the players who have done this are nothing short of legendary.
James Harden is attempting to add his name to that very short list by becoming this year’s MVP. Coming off of a disappointing finish to the season, in which the Rockets lost to the eventual champions, the Warriors, a down year was expected from the reigning MVP. With departures in free agency of some of the Rockets best players, along with many of the core getting a year older, not much was expected from the Rockets, in general, this year.

Even though at times this season the Huston Rockets have had to deal with injuries to some of their best players, one thing has remained constant: James Harden. Even after getting off to one of the slowest starts in the league and many predicting the potential of missing the playoffs, James Harden held strong and carried his team to victories. Currently, the Rockets sit in third place in the Western conference, with a record of 51-28.
Yet the question remains, how has he been able to pull this run off? It starts with his insane scoring tear that began in late December. He is currently pouring in over 36 points a game! If the season were to end today, at this rate, he would be behind only Michael Jordan and Wilt Chamberlain for highest points per game average ever.
Since James Harden has taken his scoring to a new level, the team has too. James Harden has been able to adapt his game, and elevate to a new level in order to bring his team back into the hunt for the title. Not only has James Harden been able to increase his scoring from his prior MVP season, but he also has increased his rebounding numbers.
Looking at everything James Harden has done this year, we can see a clear case for inclusion on the list of back to back MVPs. Not only has he been able to score in a way that hasn’t been seen for years, but Harden has also been able to will his team to victory even when it didn’t seem likely. Although only time will tell, to the Huston Rockets James Harden has been the most valuable.
Sources:
Photo source: https://www.houstonchronicle.com/sports/rockets/article/Rockets-James-Harden-wins-NBA-MVP-award-13025693.php
MVP history source: https://www.basketball-reference.com/awards/mvp.html
Rockets free agency misses source: https://www.cbssports.com/nba/news/2018-nba-free-agency-trevor-ariza-stunningly-will-leave-rockets-for-suns-on-1-year-contract/
League Standings: http://www.espn.com/nba/standings
Rockets injuries sources: https://www.cbssports.com/nba/news/clint-capela-injury-update-rockets-center-returns-to-practice-expected-to-play-thursday-against-lakers-per-report/
https://www.cbssports.com/nba/news/chris-paul-injury-update-rockets-star-expected-back-from-hamstring-strain-sometime-next-week/
Historical scoring source: https://www.basketball-reference.com/leaders/pts_per_g_yearly.html
James Harden stats: https://www.basketball-reference.com/players/h/hardeja01.html
0 notes
Text
PHP Constants Explained: Learn How to Use Constants in PHP
Master PHP constants with this detailed guide. Learn how to define constants using define() and const, understand use cases, and explore best practices. 🌟 Ultimate Guide to PHP Constants PHP Constants are essential for creating immutable values in your scripts — values that never change once defined. This tutorial covers everything you need to know about PHP Constants, including how to define,…
#const in PHP#define()#global constants PHP#PHP const class#PHP constant vs variable#PHP Constants#PHP magic constants
0 notes
Text
PHP Constants
PHP constants are names or identifiers that can't be changed during the execution of the script except for magic constants, which are not really constants. 2 ways can define PHP constants:
Using define() function
Using const keyword
Constants are similar to the variable, except once they are defined, they can never be undefined or changed. They remain constant across the entire program. PHP constants follow the same PHP variable rules. For example, it can be started with a letter or underscore only. Conventionally, PHP constants should be defined in uppercase letters.
0 notes
Text
Top 10 computer training institutes in hyderabad
Computer training institutes in hyderabad : With the high demand for qualified and skilled website designers and developers, training in PHP accelerates a budding IT career. Multiple content management systems (CMS) exist to help port text, images and binary data to the Web, and professionals with PHP training execute the complex operations in a hypertext environment in the CMS applications. Our training in PHP allows students to understand content management systems and build flashier web pages to create the best user experiences on the web

CAREER PROSPECTS
Functionality demanded by the Web-consuming public requires skilled professionals who can create interactive, dynamic and database-enabled web pages with a cutting edge that support a wide range of databases.
Web Designer
Web Developer
Web Programmer
Content Developer
SYLLABUS
PHP • Introduction, Importance of PHP • Web Architecture, Web Server • Install & Configure – PHP, Apache – MySQL, LAMP, WAMP, XAMPP, MAMP • Data types, Variables, Operators • Tags, Comments, PHP.ini settings • Constants – Magic, Pre/User defined • Conditional Statements • Loops, Functions • Recursive functions, String functions • Include & Require statements • Date, Time, Math • Arrays, Types, Array functions • PHP Forms, Form submit • Get & Post methods ADVANCED PHP • Regular Expressions (Validations) – Textboxes, Email, Password – Date, Phone, Zipcodes – Custom regular expressions • Sessions, Variables, Session ID – Create/Retrieve/Destroy session • Cookies, Types of Cookies – Create/Retrieve/Delete cookies • Exception Handling – Try, Throw, Catch • CRUD – Create/Read/Update/Delete • Upload/View/Download files • Pagination • User Registration • Send Emails • Authenticate users with PHP/HTTP • Introduction to Web Services
Related Searches are : Computer Training Institutes for php, Best Computer Training Institutes for php , Live Projects php , Best Institute for php in ameerpet, Computer Training Institutes for php , Best php Training institutes in Ameerpet, Best Training institute for php ,Institute for php,Online training for php ,php training institute in ameerpet. For More info : www.datadot.in (or) Call us at : 9052641113 / 9052651113
0 notes
Text
Operational Tranformation in Redis
Originally posted on March 8, 2016.
Operational Transformation (OT) is a widely used algorithm for merging changes to the same file from two simultaneous users. It is used as a base for Google Docs and countless other real-time text editing programs.
There are only a few open-source implementations of OT, though, which means that we as developers are a lot more limited. One choice is ot.js, which is designed to run in the browser and Node.JS. Unfortunately, it is limited in the sense that the documents being edited are stored in the memory of the server process, so ot.js will not work out of the box across server restarts or with a clustered server setup.
In this blog post, I explain an approach to using OT through Redis, the popular high-performance server-side key-value store, including an implementation of OT in Redis's scripting language, Lua. The methods illustrated here are used in practice by thousands of Octave Online users every day.
Background: How ot.js Works
In ot.js, every change made by a user corresponds to a list of operations. That list of operations is designed to transform a base string into the new string. There are three types of operations: insert, delete, and retain. When reconciling the list of operations, OT creates a new, empty string, and prepares to read in the base string with a "caret" at the first character. When it reads an operation, it does the following:
delete (negative integer): Some number of characters at the caret are deleted. The caret is moved forward that many characters without copying.
retain (positive integer): Some number of characters at the caret are retained. The caret is moved forward the corresponding number of characters, which each character copied into the new string.
insert (string): A string of text is inserted. The inserted string is appended to the new string. The caret in the base string is not moved.
As an example, suppose we started with the string, Hello, world!, and let's suppose that our list of operations was:
[ 7, "Earth", -5, 1 ]
We start with an empty string. The first operation says, "keep the first 7 characters". We move the caret ahead 7 places, and our new string becomes Hello,.
The second operation says, "insert 'earth' at the current location". The caret stays in place, and our new string becomes Hello, Earth.
The third operation says, "remove the next 5 characters". The caret moves ahead, and our new string remains the same.
The fourth operation says, "keep the next character". The caret, which, in case you haven't been keeping track, is pointing to the exclamation mark, is moved ahead one more character, and the exclamation mark is copied into the new string, making Hello, Earth!. Since this was the last operation, we are now finished.
Where things get interesting is when two people change the document at the same time. How to you merge their changes together? The way that ot.js handles this is by associating a "document version" with each operations list. If two operations lists A and B reference the same document version, then ot.js performs some math to efficiently transform list B to reference the document version after list A would have been applied, giving it the name operational transformation. The magic behind the transformation is beyond the scope of this post, but it's rather easy to understand if you read through the source code.
Redis Architecture Overview
You have two users, Alice and Bob, editing a text file together. Alice is in New York, and is connected to a datacenter in US-East. Bob is in Paris, and is connected to a datacenter in Europe. Each datacenter is running a copy of your server application. However, both copies of the application query the same Redis database.
When Alice makes a change to the file, her change gets sent to the US-East datacenter, which is promptly forwarded to the Redis database. Redis performs the OT magic to merge Alice's change with any changes Bob may have recently made. Then, Redis broadcasts Alice's transformed change to the Europe datacenter, which forwards it to Bob.
The Code
I'm going to assume that you have ot.js set up on the client side and attached to some sort of text editor, either a bare textarea or something more sophisticated like an ACE Editor. I'm also going to assume that you are transmitting operations over some sort of socket connection to your server on ot.js's "sendOperation" callback.
In this example, I present Node.JS code, but your server doesn't need to be running Node.JS; it could be anything (Tornado, PHP, Rails, …) as long as it supports Redis and some way to quickly send messages back and forth to the client.
Below is a function that should be run on the server whenever a user makes a change to the document. It calls a pseudo-function called "runRedisScript", which should perform an "EVAL" operation on the Redis server. You could use redis-scripto, for example, to manage your Redis scripts.
function onOtChange(docId, opsJson, revision) { runRedisScript( 4, "ot:" + docId + ":ops", "ot:" + docId + ":doc", "ot:" + docId + ":cnt", "ot:" + docId + ":sub", opsJson, revision ); };
So, what we're doing is to run our Redis script (which I will show you soon). It uses four channels:
ops: A List containing JSON strings of every operation performed on the document.
doc: An up-to-date copy of the document, useful if you need to persist the document across sessions.
cnt: The latest revision number.
sub: A channel for Redis pub-sub notifications of new operations against the document.
Here is the code for the Redis script that will be run.
local ops = cjson.decode(ARGV[1]) local rev = tonumber(ARGV[2]) local ops_key = KEYS[1] local doc_key = KEYS[2] local sub_key = KEYS[3] local cnt_key = KEYS[4] -- Load any concurrent operations from the cache local concurrent = redis.call("LRANGE", ops_key, rev, -1) -- Transform the new operation against all the concurrent operations if concurrent then for i,cops in pairs(concurrent) do ops = transform(ops, cjson.decode(cops)) end end -- Save the operation redis.call("RPUSH", ops_key, cjson.encode(ops)) redis.call("INCR", cnt_key) -- Load and apply to the document local doc = redis.call("GET", doc_key) if type(doc)=="boolean" then doc="" end doc = apply(doc, ops) redis.call("SET", doc_key, doc) -- Publish to the subscribe channel redis.call("PUBLISH", sub_key, cjson.encode(ops))
First, we read the arguments. Then we load the concurrent operations lists from the ops key. Then we perform the OT magic. Then we save the new operation into the ops key, update the other keys, and publish the operation to the sub channel.
Where is the implementation of transform and apply, you ask? You can find it in my Gist in the file ot.lua.
Back in Node.JS, now, all we need to do is broadcast the operation to all clients. We can make a Redis client to subscribe to the "sub" channel, and whenever something comes through that channel, we broadcast it through all the websocket connections. When the operation gets to the client, we can apply it to the document by calling ot.js's "applyServer" command (or, if applicable, "serverAck" on the client that first produced the operation).
Caveat: UTF-8 Support
For the most part, my ot.lua is transcribing from ot.js. However, one thing that I discovered through that process is that Lua has really crappy support for unicode! Lua, which only knows about single-byte characters, would do ugly things like split multibyte characters in half. To solve this problem, I had to include some UTF-8 code that is capable of correctly calculating string length and substrings.
Caveat: Expiring Keys
In addition to the transform and apply operations, my Gist also contains the rest of the Lua code from this post, with the bonus feature of supporting ops lists that expire after a certain amount of time. This helps keep the amount of data stored in Redis is constant over time. When running the scripts, you should pass in additional arguments corresponding to the number of seconds to keep operations alive in the cache. A couple of minutes should be more than enough time.
Conclusion
I hope that this approach to using a Redis cache as an Operational Transformation server proves useful. OT sounds scary, but it really isn't.
If you like this post, let me know by commenting below!
0 notes
Text
Will I Shed My Tax Obligation Reimbursement If I'm Filing Bankruptcy In Missouri Or Even Illinois?
When it comes to special day events, you can easily picture nothing at all apart from pleasure, joy and happiness and also pleasure. Gomez's constant "companion" considering that Gomez's childhood years, Trait is consistently ready to help member of the family with slight regular companies and diversions, including raising the recipient on telephones, retrieving the email, igniting smokes, putting tea, and participating in mentally stimulating games.

Definitely she has actually found photos of penises in the past, maybe even put up ones-they probably illustration all of them off real-time versions in Sexual activity Education-but this one was personal, see this here was actually indicated for her (and also having said that numerous different ladies on M's checklist.) This set remained in big, veiny close-up. I holidayed thrice or so in Uncle Chukwuka's home as well as each time he was actually putting on a T-shirts that had been worn in appreciation for some lifeless uncle with the engraving 'Adios Papa' on the back, over some whitewashed pants and also matching boots. That's the renowned Marshall Field structure (absorbed through Macy's) - the one along with the Christmas time windows folks took their children midtown to observe, Frango mints, as well as the Pine Area where affluent girls consumers made use of to comply with for lunch. "Our company simply began so our company're getting some brand-new individuals and also gradually, slowly it feels like it is actually getting better," Al Isso said to CBC Information, communicating via his uncle Omar Al Isso, which acted as an explainer.
The account is actually after that separated into pair of lines, one observing Eliza's narrow leaves as well as death, her reunion along with her husband George (George had actually additionally escaped his master as a result of the abuses he experienced) and their resulting retreat to Canada; the second line follows Uncle Tom's lifestyle as a servant in the St. Clare house, as well as his friendship with the little girl of our home, Eva, as well as is actually the major storyline from the book. Unlike the series' portrayal from the home of the Dowager Lady of Norfolk as a sanctuary for distantly similar "noble bastards" as well as the outcoming effects that Catherine Howard was a misbegotten little one, in real life the Dowager Duchess was actually Catherine's step-grandmother, better half of Catherine's deceased grandpa the Second Battle each other from Norfolk, and Catherine was actually born to among the 2nd Fight it out's many boys in legal holy matrimony - she was actually delivered to live in the family because her daddy was actually poverty-stricken as well as recently widowed. Maintain her in your cellar as well as fuck her 3 or even four times a time, maybe throw in a little bit of a pounding once in a while, nourish her consistently with your own palms and also continuously alternate informing her just what an insignificant slut she is actually with telling her the amount of you adore her, and in a week, bests, you'll manage to undo her and lead to the available door, and also she'll get on her knees as well as plead you, crying on your feets, to certainly not create her leave of absence. Ashore our experts were greeted by extremely pleasant people hustling horseback flights up the hill, or if you choose a hiking guide to lead you up. The starting cost for a steed as well as mandatory quick guide was 500 PHP, $11 per person, however my hubby bargained as well as ended up spending all of them 1500 PHP, $32, for all 4 people. I have actually listened to there was an admission cost, but nobody existed to collect it, so I am actually not sure if this was actually featured with the horse hire. Hey there to each out listed here, am actually right here to share the unexpected magic that happened to me three days back, My title is Excellence Story, i live in TEXAS, I' m merrily wed to a beautiful and also caring spouse, with 2 children A huge issue took place in my family members seven months back, between me as well as my other half thus terrible that she had the case to court for a breakup she pointed out that she never intended to stick with me once again, and that she carried out not love me any longer So she stuffed from my house and created me as well as my youngsters gone through severe ache.
0 notes
Text
So I guess I should start at the beginning. I mean where else would I start? I've always wanted a big family. A house full of kids running around. The chaos seemed like an exciting adventure, something I felt like I was meant to do. That was the plan. So as of right now, I have a 6 year old named wesley and a 4 year old, nora. They are my two greatest accomplishments. But I still feel a void, I’ve prayed another child would complete me. Complete my family. Make me feel a sense of worth.
And up until July of 2015, my life had been pretty easy. I had the occasional bumps in the road, I had trauma in my high school years that caused the occasional depression if I would let my mind go there. I would actually sing to myself sometimes If a bad memory would start creeping in, it helped, your brain can't occupy two thoughts at once, or so I've heard. When I look back now, my "norms" were not normal. But all in all, life was good. I didn't have to appreciate the "good days" because most days went by uneventful. (in a good way)
With OCD there's something called "scrupulosity", its sort of like magical thinking, its the fear of being guilty of religious, moral, or ethical failure. Like karma x100, This was part of "my OCD". I felt like God would punish me if mentioned having another child. (are you thinking I'm crazy, yet? ... it gets worse.) I’d constantly make deals with God. I felt like God was punishing me.
Fast forward to July 2015, perhaps it was a coincidence my OCD spiraled out of control on the same week the "trauma" I experienced as a teen was aired on the news , same guy, different girl.
I thought I was dealing with it, a few nights later I had a little too much to drink and discussed having another child with my husband., he didn't say much, just that he wanted to think about it. Afterward we made love. A night that will forever be burned into my memory. When I woke up the next morning my mind began to race (something very common with OCD), I wasn't familiar with this though, it was almost like someone flipped a switch in my brain. I felt worthless, disgusting, alone. My mind was telling me," you have herpes. and If you have herpes your life isn't worth living." Worst of all I felt insane. I remember Jason took me to see the new Jurassic Park movie, poor guy had no idea how to deal with this either. My parents took my kids for the evening, The beginning of what my kids would consider their second home for the next 18 months. Thank god for my family. When we got to the movies jason gave me an ativan to calm me down, I remember being a little out of it but every celebrity in the movie I would try to imagine if they could live with the thought of having herpes. With OCD you don't get to decide what scares you, your mind lies to you. Your mind, the thing thats suppose to help you think logically is in constant fight or flight mood. They also call OCD the doubting disorder. You don't believe your own thoughts. If I leave the house and I watch myself unplug the straightener, my mind will make me believe, hmmm... maybe you didn't. Then I’d have to go back and check.
I had to stay at my parents for a while, The two kids that had given my life meaning were now just getting in the way of my compulsions and ruminations. I went to urgent care 8 times before the doctors there refused to check me. Then I started going to my OBgyn. After my third day there in a row she mentioned something I had never considered, She said she suspected I was OCD. So we went home and googled the symptoms. Its almost like finding that missing puzzle piece that makes your life make a lot more sense. I wasn't a quirky kid, or an awkward, quiet teenager, I was OCD.
During these first few months I had lost about 15 pounds.
I tried every medicine out there. Antipsychotics that just made me sleepy. countless SSRI's that did absolutely nothing. I woke up every single morning like I had this giant boulder on my chest. My hands would feel numb, my heart would race, my mind would race. Every morning. I would sit on our back porch swing and smoke cigerarttes, one after the other. I constantly fantasized about suicide to end the relentless pain I was feeling. How death would give me the release I longed for. I made plans, wrote letters to my family. I remember one thing I wrote to my dad that sticks out in my mind"...Don't let this ruin your life." I was so ignorant and full of pain back then. I even picked out a white dress, it looked like something you might get baptized in. (later I found out my mom burned the dress)
My "plans" were always interrupted. Thank God. and just as a side note, my kids were never home for these “plans”
I remember begging my family to check me in somewhere and just leave me there. I was convinced I was crazy. The first place we tried was a treatment center in LA that claimed they treated OCD. It was a PHP program (partial hospitalization program). 12 weeks of group therapy that did nothing but babysit me while my family worked and my kids were in school. I felt hopeless. Then I started to see a different treatment team from new orelans, which helped a little until they told me my OCD and depression was too severe for them to treat and referred me to a residential treatment center.
My family was 100% against me going across the country to get help, so I made the plans, arranged the flights, and left on not so good of terms. By the second day my mother was telling me how proud she was I had made the decision to go. I think as a parent you just want to fix your kids and keep them close. I spent roughly 7 months in Wisconsin, and met the most amazing people. I learned about my disorder, how to cope, I was able to let my guard down and know that everyone there new my pain. I formed connections that get me through hard times now.
Since being home I've done 39 sessions of TMS. (transcranial magnetic stimulation) and 9 sessions of ECT (electric shock therapy) I stopped going to ECT when I recognized one of the nurses assisting in the procedure. I remember feeling so humiliated.
I still struggle and have bad days, and then some decent ones. I feel like I'm learning to ride the bad days out and hold on until I get a grip. I still take 14 showers some days. and change 10 times before I feel "okay" I finally think we've found the right meds for me though.
And Jason and I have started trying for another baby. I'm starting back at school this week. OCD wants my life. It fights like hell to take every bit of joy from me. But I'm learning to fight back One day at a time. Or as my mom calls my triggers , an "oppurtonity to fight back". I know there will be more ugly days. But I feel like with all of this pain There has to be a reason.
3 notes
·
View notes
Text
Pertanyaan Interview PHP yang Sering Ditanyakan

Hypertext Preprocessor atau PHP merupakan bahasa scripting khusus untuk pengembangan web, dapat ditanamkan ke HTML, dan sebagian besar dijalankan pada server. Bahasa ini kompatibel dengan berbagai platform, seperti Windows, Linux, MacOSX, dan kompatibel dengan sebagian besar server, seperti Apache dan IIS. Kalau Anda ingin menjadi seorang PHP developer, berikut beberapa pertanyaan interview PHP yang sering ditanyakan.
Contoh Pertanyaan Interview PHP Tingkat Dasar
Sumber Foto : diannurmayasari.wordpress.com
Apa itu PHP?
Jawaban: PHP adalah bahasa skrip untuk keperluan umum, sebagian besar diimplementasikan dalam C dan C ++ yang cocok untuk pengembangan web. Ini adalah bahasa berkinerja tinggi karena kode tidak perlu dikompilasi sebelum dieksekusi. PHP dapat digunakan secara gratis, open source, dan dapat dengan mudah dipelajari. Sebagian besar server web hosting mendukung PHP secara default, sehingga menghemat biaya.
Jelaskan perbedaan antara $ dan $$ message?
Jawaban: $ message adalah variabel biasa, yang memiliki nama tetap dan nilai tetap. Sedangkan $$ message adalah variabel referensi, yang menyimpan data tentang variabel tersebut. Nilai $$ message dapat berubah secara dinamis saat nilai variabel berubah.
Jelaskan magic constant di PHP.
Jawaban: Magic constant dimulai dan diakhiri dengan garis bawah ganda dan merupakan konstanta standar yang mengubah nilainya berdasarkan konteks dan penggunaan. 9 konstanta ajaib di PHP, yaitu __LINE__, __FILE__, __DIR__, __FUNCTION__, __CLASS__, __TRAIT__, __METHOD__, __NAMESPACE__, ClassName :: class
Jangan lupa juga pelajari tipe data PHP, fungsi isset (), array, dan string, array terindeks dan asosiatif, serta perbedaan require dan include.
Contoh Pertanyaan Tingkat Menengah
Bagaimana cara mengupload file di PHP?
Jawaban: Pertama, membuat direktif file_uploads = On. Kemudian tambahkan metode tindakan sebagai ‘post’ dengan jenis pengkodean sebagai ‘multipart / form-data.’
<formaction = “myupload.php” method = “post” enctype = “multipart / form-data”>
File myupload.php berisi kode khusus untuk file yang akan diunggah dan berbagai detail lainnya. Tulis kode HTML untuk mengupload file yang Anda inginkan dengan menentukan jenis input sebagai ‘file.’
Jelaskan mengenai cookie dan cara membuat cookie di PHP
Jawaban: Cookie menyimpan data tentang pengguna di browser untuk mengidentifikasi pengguna dan disematkan di komputer pengguna ketika meminta halaman tertentu. Pembuatan cookie di PHP menggunakan fungsi setcookie ():
setcookie (nama, nilai, kedaluwarsa, jalur, domain, aman, httponly); Di situ nama wajib diisi, dan pilihan lainnya opsional. Contoh, setcookie (“instrument_selected”, “guitar”)
Jelaskan perbedaan antara permintaan GET dan POST.
Jawaban: GET menampilkan data yang dikirimkan sebagai bagian dari URL. Ini tidak terjadi saat menggunakan POST, karena data dikodekan dalam permintaan. Jumlah karakter maksimum yang ditangani oleh GET adalah 2048, sedangkan pada POST tidak ada batasan.
GET hanya mendukung data ASCII, sedangkan POST mendukung data ASCII, data biner, dan data lainnya. Penggunaan GET biasanya untuk mengambil data, sedangkan POST digunakan untuk memasukkan dan memperbarui data.
Untuk pertanyaan interview PHP tingkat menengah lain, seperti membuat koneksi database dan query di PHP, pentingnya Parser di PHP, fungsi dan tujuan konstanta (), Path Traversal, serta fungsi mail dan sintaksnya.
Selain pertanyaan di atas, jangan lupa mempeajari pertanyaan tingkat lanjut, seperti tentang memcache dan memcached, typecasting, menghubungkan database MySQL dari skrip PHP, dan penyebab JavaScript dan PHP tidak dapat berinteraksi secara langsung serta cara mengatasinya.
Pertanyaan interview PHP lainnya yang termasuk tingkat lanjut, seperti konstruktor dan destruktor, jenis kesalahan umum di PHP, metode hashing terbaik untuk kata sandi, perbedaan antara pernyataan echo dan print, typecasting dan type juggling, dan cara memperpanjang waktu eksekusi skrip PHP.
Baca juga : 5 Sertifikasi PHP Terbaik Tahun 2021 yang Wajib Anda Miliki
1 note
·
View note